import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
// 一级路由
const Index = () => import("../views/Index.vue")
// 二级路由
const Home = () => import("../views/Index/Home/Home.vue")
const Dataday = () => import("../views/Index/Datareport/Dataday.vue")
const Datamonth = () => import('../views/Index/Datareport/Datamonth.vue')
const Grouping=()=>import('../views/Index/Product/Grouping.vue')
const Classify=()=>import('../views/Index/Product/Classify.vue')
const Warehouse=()=>import('../views/Index/Product/Warehouse.vue')
const Product=()=>import('../views/Index/Product/Product.vue')
const Comment=()=>import('../views/Index/Product/Comment.vue')
const Specification=()=>import('../views/Index/Product/Specification.vue')
const Three=()=>import('../views/Index/Member/Three.vue')
const Membermanagement=()=>import('../views/Index/Member/Membermanagement.vue')
const Client=()=>import('../views/Index/Member/Client.vue')
const Search=()=>import('../views/Index/Management/Search.vue')
const Notice=()=>import('../views/Index/Management/Notice.vue')
const Slideshow=()=>import('../views/Index/Management/Slideshow.vue')
const Self=()=>import('../views/Index/Management/Self.vue')
const Freight=()=>import('../views/Index/Management/Freight.vue')
const Order=()=>import('../views/Index/Order/Order.vue')
const Site=()=>import('../views/Index/System/Site.vue')
const Administrator=()=>import('../views/Index/System/Administrator.vue')
const Role=()=>import('../views/Index/System/Role.vue')
const Menu=()=>import('../views/Index/System/Menu.vue')
const Timing=()=>import('../views/Index/System/Timing.vue')
const Parameter=()=>import('../views/Index/System/Parameter.vue')
const MenSystemlogu=()=>import('../views/Index/System/Systemlog.vue')
const routes = [{
    path: '/index',
    name: 'Index',
    component: Index,
    children: [{
        path: '/index/home',
        name: 'Home',
        component: Home
      },
      {
        path: "/index/dataday",
        name: "Dataday",
        component: Dataday
      }, {
        path: "/index/datamonth",
        name: "Datamonth",
        component: Datamonth
      },{
        path: "/index/grouping",
        name: "Grouping",
        component: Grouping
      },{
        path: "/index/classify",
        name: "Classify",
        component: Classify
      },{
        path: "/index/warehouse",
        name: "Warehouse",
        component: Warehouse
      },{
        path: "/index/product",
        name: "Product",
        component: Product
      },{
        path: "/index/comment",
        name: "Comment",
        component: Comment
      },{
        path: "/index/specification",
        name: "Specification",
        component: Specification
      }
      ,{
        path: "/index/three",
        name: "Three",
        component: Three
      }
      ,{
        path: "/index/membermanagement",
        name: "Membermanagement",
        component: Membermanagement
      }
      ,{
        path: "/index/client",
        name: "Client",
        component: Client
      },{
        path: "/index/search",
        name: "Search",
        component: Search
      },{
        path: "/index/notice",
        name: "Notice",
        component: Notice
      },{
        path: "/index/slideshow",
        name: "Slideshow",
        component: Slideshow
      },{
        path: "/index/self",
        name: "Self",
        component: Self
      },{
        path: "/index/freight",
        name: "Freight",
        component: Freight
      },{
        path:'/index/order',
        name: "Order",
        component: Order
      },{
        path:'/index/site',
        name: "Site",
        component: Site
      },{
        path:'/index/administrator',
        name: "Administrator",
        component: Administrator
      },{
        path:'/index/role',
        name: "Role",
        component: Role
      },{
        path:'/index/menu',
        name: "Menu",
        component: Menu
      },{
        path:'/index/timing',
        name: "Timing",
        component: Timing
      },{
        path:'/index/parameter',
        name: "Parameter",
        component: Parameter
      },{
        path:'/index/menSystemlogu',
        name: "MenSystemlogu",
        component: MenSystemlogu
      }
    ]
  },
  {
    path: '/index/home',
    redirect: '/'
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router